<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>商品分类</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../script/vant/index.css" />
    <link rel="stylesheet" type="text/css" href="../css/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="css/common.css" />
    <link rel="stylesheet" type="text/css" href="css/search.css" />
    <link rel="stylesheet" type="text/css" href="css/product_sort.css" />
    <style>
        
    </style>
</head>

<body>
    <div id="app" >
        <!-- 编辑商品分类 -->
        <van-dialog v-model="showEdit" title="编辑商品分类" :before-close="beforeedit_type" show-cancel-button >
            <div class="dialog_tishi">
                <div class="dialog_item edit_win" style="height: 1.6rem; line-height: 1.6rem;">
                    <div class="dia_item_title fl">分类名称:</div>
                    <div class="dia_item_dec fr">
                        <input type="text" placeholder="请填写分类名称" v-model="sortname">
                    </div>
                </div>
            </div> 
        </van-dialog>
        <!-- 新增商品分类 -->
        <van-dialog v-model="showAdd" title="新增商品分类" :before-close="beforeadd_type" show-cancel-button >
            <div class="dialog_tishi">
                <div class="dialog_item edit_win">
                    <div class="dia_item_title fl">上级分类:</div>
                    <div class="dia_item_dec fr">{{sortitem.Name}}</div>
                </div>
                <div class="dialog_item edit_win" style="height: 1.6rem; line-height: 1.6rem;">
                    <div class="dia_item_title fl">分类名称:</div>
                    <div class="dia_item_dec fr">
                        <input type="text" placeholder="请填写分类名称" v-model="sortname">
                    </div>
                </div>
            </div> 
        </van-dialog>
        <div class="tree_center">
            <div class="timerdec mt0 mb10 pl15">说明：最多支持建立三级分类</div>
            <div class="tree_all">
                <div class="tree_item">
                    <div class="tree_item_lft aui-ellipsis-1 fl" v-on:click="do_openall()">
                        <i v-if="showAll" class="icon iconfont icon-zhankai color9"></i>
                        <i v-if="!showAll" class="icon iconfont icon-gengduo font7 color9"></i>
                        <span class="font8">全部分类</span>
                    </div>
                    <div class="tree_item_rgt fr">
                        <i class="icon iconfont icon-xinzeng right_icon" v-on:click="add_type({Name:'全部分类'})"></i>
                    </div>
                </div>
                <div v-if="showAll" class="tree_all pl25" v-for="item in sortList">
                    <div class="tree_item">
                        <div class="tree_item_lft aui-ellipsis-1 fl"  v-on:click="do_opentype(item.ID)">
                            <i v-if="item.IsSelected" class="icon iconfont icon-zhankai color9"></i>
                            <i v-if="!item.IsSelected" class="icon iconfont icon-gengduo font7 color9"></i>
                            {{item.Name}}
                        </div>
                        <div class="tree_item_rgt fr">
                            <i v-if="item.children==undefined" v-on:click="remove_type(item.ID)" class="icon iconfont icon-shanchu2 right_icon"></i>
                            <i v-on:click="edit_type(item)" class="icon iconfont icon-bianji right_icon"></i>
                            <i v-on:click="add_type(item)" class="icon iconfont icon-xinzeng right_icon"></i>
                        </div>
                    </div>
                    <div v-if="item.IsSelected" class="tree_all pl25" v-for="item2 in item.children">
                        <div class="tree_item pl15">
                            <div class="tree_item_lft aui-ellipsis-1 fl">
                                {{item2.Name}}
                            </div>
                            <div class="tree_item_rgt fr">
                                <i v-on:click="remove_type(item2.ID)" class="icon iconfont icon-shanchu2 right_icon"></i>
                                <i v-on:click="edit_type(item2)" class="icon iconfont icon-bianji right_icon"></i>
                            </div>
                        </div>
                    </div>
                </div>
                
            </div>
        </div>

    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/config.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript " src="../script/vant/vue.js"></script>
<script type="text/javascript " src="../script/vant/vant.js"></script>
<script type="text/javascript" src="../script/aui-tab.js"></script>
<script type="text/javascript " src="js/product_sort.js"></script>
<script type="text/javascript"></script>
</html>
